import request from '@/utils/request'

// 查询销售单列表
export function listErpSale(query) {
  return request({
    url: '/erp/ErpSale/list',
    method: 'get',
    params: query
  })
}

// 查询销售单详细
export function getErpSale(saleId) {
  return request({
    url: '/erp/ErpSale/' + saleId,
    method: 'get'
  })
}

// 新增销售单
export function addErpSale(data) {
  return request({
    url: '/erp/ErpSale',
    method: 'post',
    data: data
  })
}

// 修改销售单
export function updateErpSale(data) {
  return request({
    url: '/erp/ErpSale',
    method: 'put',
    data: data
  })
}
// 更改物流状态
export function logistics(data) {
  return request({
    url: '/erp/ErpSale/logistics',
    method: 'put',
    data: data
  })
}

// 删除销售单
export function delErpSale(saleId) {
  return request({
    url: '/erp/ErpSale/' + saleId,
    method: 'delete'
  })
}


// 审核销售单
export function auditErpSale(data) {
  return request({
    url: '/erp/ErpSale/audit',
    method: 'put',
    data: data
  })
}

// 汇总备货查询
export function getSummaryStockList(query) {
  return request({
    url: '/erp/ErpSale/getSummaryStock',
    method: 'get',
    params: query
  })
}